package com.grep.base.util;

import java.io.File;

public class FilePathUtil {

	public static void mkdir(String path){
		String [] names = null ;
		if(path != null){
			names = path.split("//") ;
		}
		if(names !=null){
			for(int i = 0 ;i < names.length ;i++){
				String fileName = names[0] + "//"  ;
				for(int j = 1 ; j <= i; j ++){
					fileName += names[j] + "//" ;
				}
				makeDir(fileName);
			}
		}
	}
	private static void makeDir(String dirName){
		if(dirName != null && !"".equals(dirName.trim())){
			File file = new File(dirName) ;
			if(!file.isDirectory()){
				file.mkdir();
			}
		}
	}
 
	public static void main(String [] path){
		try{
			mkdir("itunes.apple.com.cn.genre") ;
		}catch (Exception e){
			e.printStackTrace();
		}
	}
}
